package com.sky.mapper.user;

import com.sky.pojo.Dish;
import com.sky.pojo.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {
    List<ShoppingCart> queryData(ShoppingCart shoppingCart);
    @Update("update shopping_cart set number=#{number} where user_id=#{userId} ")
    void updateNumber(ShoppingCart shoppingCart);
    void insert(ShoppingCart shoppingCart);

    @Select("select * from shopping_cart where user_id=#{userId}")
    List<ShoppingCart> list(Long userId);

    @Delete("delete from shopping_cart where user_id=#{userId}")
    void cleanShoppingCart(Long userId);
    /**
     * 获取用户送餐期望时间
     */
    Integer selectTotalMakeTimeByUserId(Long currentId);
}
